<template>
  <div>
    <div class="wodeshoucang">我的收藏</div>
    <div class="soucangmanhua">
      <div v-for="item in shoucang" :key="item.id">
        <div>
          <img
            @click="changeManhuua(item.comic_id)"
            :src="item.vcover + '@230w.png'"
            alt=""
          />
        </div>
        <div>
          {{ item.title }}
        </div>
      </div>
      <div @click="seleteHome">
        <div>＋</div>
        <div>添加</div>
      </div>
    </div>
  </div>
</template>

<script>
// import {getShouCangManhua} from '@/api/index.js'
export default {
  data() {
    return {
      ss: 111,
      shoucang: null,
    };
  },
  methods: {
    getShowcang() {
      this.$axios
        .get(
          `https://apis.netstart.cn/bcomic/GetFavComics?uid=504372610&pageSize=14&pageNum=1`
        )
        .then((result) => {
          this.shoucang = result.data.data.fav_comics;
        })
        .catch((err) => {
          console.log(err);
        });
    },
    seleteHome() {
      this.$router.push("/home");
    },
    changeManhuua(id) {
      this.$emit("change-manhuua", id);
    },
  },
  created() {
    this.getShowcang();
  },
};
</script>

<style lang="less" scoped>
.wodeshoucang{
    color: @color4;
    font-size: 18rem;
    text-align: left;
    margin-left: 15rem;
    padding-top: 40rem;
}
.soucangmanhua {
  width: 345rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-around;
  margin: 0 auto;
  padding-top: 15rem;
  > div {
    width: 105rem;
    color: @color4;
    font-size: 12rem;
    text-align: left;
    img {
      width: 105rem;
    }
    > div:nth-child(2) {
      margin-top: 7rem;
      height: 30rem;
      overflow: hidden;
    }
    > div:nth-child(1) {
      margin-top: 15rem;
    }
  }
  > div:last-child {
    width: 105rem;
    height: 140rem;
    border: 1px solid @color1;
    margin-top: 15rem;
    > div:nth-child(1) {
      font-size: 50rem;
      color: @color1;
      text-align: center;
    }
    > div:nth-child(2) {
      font-size: 20rem;
      color: @color1;
      text-align: center;
    }
  }
}
</style>